
#ifndef __DEV_JC_H__
#define __DEV_JC_H__

#include "sys_port.h"
#include "dev_off.h"
#include "dev_off_line.h"
#include "root.h"

#define DEV_JC_STOP      (0)
#define DEV_JC_OPENING   (1)
#define DEV_JC_CLOEING   (2)

#define CMD_JC_STOP     (0)
#define CMD_JC_OPEN     (1)
#define CMD_JC_CLOSE    (2)

#define JC_BAR_POS_X 68

typedef struct 
{
    char  devid[128];
    char  body[128];
    char  action;
}jc_http_req_t;


typedef struct 
{
    char   devname[128];
    char   devid[128];
    char   devtype[128];
    char   devsubtype[128];

    int    is_notrip; //无行程

    int    workstatus; 
    int    status;
    int    old_val;
    int    target_val;

    int    cur_val;
    int    min;
    int    max;
}ui_jc_data_t;

typedef struct 
{
    lv_obj_t * bg_img;

    lv_obj_t * left;
    lv_obj_t * left_img;

    lv_obj_t * btn_stop;
    lv_obj_t * btn_stop_img;

    lv_obj_t * right;
    lv_obj_t * right_img;

    lv_obj_t * bar;
    lv_obj_t * bar_head;
    lv_obj_t * bar_txt; 
    
    lv_timer_t * time;

	ui_dev_off_t      dev_off;
    ui_dev_off_line_t dev_off_line;


    lv_obj_t * notrip_bg_img;
    lv_obj_t * notrip_title;
    lv_obj_t * notrip_txt;
        
}ui_jc_obj_t;

typedef struct 
{
    ui_jc_data_t  data;
    ui_jc_obj_t   ui;
}ui_dev_jc_t;

dev_info_t* dev_jc_reg(ui_jc_data_t* dev);
int dev_jc_unreg(dev_info_t* devinfo);

page_info_t* dev_jc_page_reg(ui_dev_jc_t* jc);

#endif
